<include file="__THEME__/header" />
<include file="__THEME__/page_top" />
<style>
.uploadify{
	top: 0px;
	position: absolute;
}
.uploadify object{
	left:0px;
}
</style>
<div class="w_970 b_tf">
	<div class="fl w_720">
    	<div class="">
    		<h2 class="t_26 c_666 bold_n p_t25 m_b10">专业会员认证</h2>
            <p class="t_14 c_666 ">作为以个专业会员，如果您被索乐认证，即可获得展示与评论功能！</p>
            
        </div>
        <h2 class="t_14 c_333 b_b p_t10 p_b10 m_b10">填写认证信息</h2>
        <form name="ajax_verified_form" id="ajax_register_form" method="POST" action="{:U('public/Register/save')}">
        <input type="hidden" name="card_image" value="">
        <input type="hidden" name="works_image" value="">
        <div class="login_dl ov p_t25 b_b p_b10">
        	<ul id="card_image_wrap" class="ab login_ul" >
        	</ul>
            <dl>
                <dt></dt>
                <dd>
                    <div class="">
                        <div class="m_b10">
                        	<a  class="tc butas bor di b_fff w_255 c999 m_r10 t_14" href="javascript:;" style="position: relative;">
                        		上传证件照片&gt;
                        		<input id="uploadify_card_image" style="display:none" type="file" />
                        	</a>
                        	<i class="c_999">(必传)</i>
                        </div>
                        <p class="c_999 l_20">身份证／护照均可，扫描或者用相机拍摄下来，保持证件清晰。</p>
                        <p class="c_999 l_20">您的证件仅限于审核使用，索乐会严格保护您的隐私！</p>
                    </div>
                </dd>
            </dl>
            <dl>
                <dt>证件号码：</dt>
                <dd><input id="idcard" name="idcard" type="text" value="" class="iut">
                	<div class="bc  c_999">(必填，必须与提交的证件号码一致)</div>
                </dd>
                
            </dl>
        </div>
        <div class="login_dl ov p_t25 b_b" style="padding-bottom:80px">
        	<ul id="works_image_list" class="ab login_ul" >
        	</ul>
            <dl>
                <dt></dt>
                <dd>
                    <div class="">
                        <div class="m_b10">
                        	<a class="tc butas bor di b_fff w_255 c999 m_r10 t_14" href="javascript:;" style="position: relative;">
                        		上传本人的相关作品&gt;
                        		<input id="uploadify_works_image" style="display:none" type="file" />
                        	</a>
                        	<i class="c_999">(必传)</i>
                        </div>
                        <p class="c_999 l_20">最少上传2张，根据自己从事行业，上传相关作品图片。</p>
                       
                    </div>
                </dd>
            </dl>
            <dl>
                <dt>个人简介：</dt>
                <dd><textarea id="info" name="info" cols="" rows="" class="login_textarea p_q5 bor l_20 b_e6e6e6"></textarea>
                	<div class="bc  c_999"><i class="fr">160</i>用160字简单的介绍下自己</div>
                </dd>
                
            </dl>
        </div>
         <div class="login_dl ov p_t25 b_b p_b10">
        	
            <dl>
                <dt>手机号码：</dt>
                <dd><input id='phone' name='phone' type="text" value="" class="iut">
                	 <div class="bc  c_999">(不会公开，请放心填写，方便我们的认证专员核实您的真实身份)</div>
                </dd>
               
            </dl>
            <dl>
                <dt>验证码：</dt>
                <dd><input type="text" value="" class="iut m_r10" style="width:120px"><span class="c_ccc m_r10">60秒后重新获取</span><a class="tc di login_hq w_98 c_f06" href="#">获取免费验证码</a>
                	<div class="bc  c_999">填写验证码，让我们知道你的手机事真实的</div>
                </dd>
                
            </dl>
        </div>
        <p class="tc p_t25 m_b20"><a class="tc butas bor di b_fff w_255 c_f06 m_r10 t_14" 
        	href="javascript:;" onclick="$('#ajax_verified_form').submit();">申请认证</a></p>
  
	</div>
    <div class="fr w_220">
    	<div class="b_b login_110 m_b10" style="padding-top:20px">
        	<p class="t_14 c_666" style="padding-top:80px">为什么专业会员要认证？</p>
        </div>
        <p class=" c_666 l_20">有关帐户注册的更多信息，请查看<a href="#" class="c_009">我们的常见问题</a>。</p>
    </div>
</div>
<script src="__THEME__/js/uploadify/jquery.uploadify.min.js?v={$site.sys_version}"></script>
<script>
$(document).ready(function() { 
	var unid = "{$unid}",
	fileSizeLimit = "{$fileSizeLimit}";
	$('#uploadify_card_image').uploadify({
		formData: {
			attach_type: 'feed_image',
			upload_type: 'image',
			thumb: 1,
			width: 105,
			height: 80,
			cut: 1,
			PHPSESSID: "<?php echo session_id(); ?>"
		},
		fileSizeLimit: fileSizeLimit,
		fileTypeDesc: 'Image Files',
    	fileTypeExts: "<?php echo $fileTypeExts; ?>",
		swf: THEME_URL + '/js/uploadify/uploadify.swf',
		uploader: U('widget/Upload/save'),
		width: 258,
		height: 40,
		buttonText : '',
		queueSizeLimit: 9,
		queueID: true,
		overrideEvents: ['onSelectError', 'onDialogClose'],
		onUploadSuccess : function(file, data, response) {
			// 解析JSON数据
			var jsondata = $.parseJSON(data);
			if (jsondata.status === 1) {
				$("input[name='card_image']").val(jsondata.data.save_path + jsondata.data.save_name);
				var html = "<li><img src='"+jsondata.data.src+"' width='105' height='80' /></li>";
				$("#card_image_wrap").html(html);
			}
		},
		onSelectError: function (file, errorCode, errorMsg) {
			switch (errorCode) {
				case -100:
					ui.error('选择的上传数目超过，您还能上传'+errorMsg+'个图片');
					break;
				case -110:
					ui.error("文件 [" + file.name + "] 大小超出系统限制的" + $('#uploadify_card_image').uploadify('settings', 'fileSizeLimit') + "大小", 4);
					break;
				case -120:
					ui.error("文件 [" + file.name + "] 大小异常");
					break;
				case -130:
					ui.error("文件 [" + file.name + "] 类型不正确");
					break;
			}
		},
		onFallback: function () {
			ui.error('您未安装FLASH控件，无法上传！请安装FLASH控件后再试');
		},
		onUploadStart: function (file) {
			
		}
	});
	
	$('#uploadify_works_image').uploadify({
		formData: {
			attach_type: 'feed_image',
			upload_type: 'image',
			thumb: 1,
			width: 105,
			height: 80,
			cut: 1,
			PHPSESSID: "<?php echo session_id(); ?>"
		},
		fileSizeLimit: fileSizeLimit,
		fileTypeDesc: 'Image Files',
    	fileTypeExts: "<?php echo $fileTypeExts; ?>",
		swf: THEME_URL + '/js/uploadify/uploadify.swf',
		uploader: U('widget/Upload/save'),
		width: 258,
		height: 40,
		buttonText : '',
		queueSizeLimit: 9,
		queueID: true,
		overrideEvents: ['onSelectError', 'onDialogClose'],
		onUploadSuccess : function(file, data, response) {
			// 解析JSON数据
			var jsondata = $.parseJSON(data);
			if (jsondata.status === 1) {
				$("input[name='works_image']").val($("input[name='works_image']").val() + jsondata.data.save_path + jsondata.data.save_name + ";");
				var html = "<li><img src='"+jsondata.data.src+"' width='105' height='80' /></li>";
				$("#works_image_list").append(html);
			}
		},
		onSelectError: function (file, errorCode, errorMsg) {
			switch (errorCode) {
				case -100:
					ui.error('选择的上传数目超过，您还能上传'+errorMsg+'个图片');
					break;
				case -110:
					ui.error("文件 [" + file.name + "] 大小超出系统限制的" + $('#uploadify_card_image').uploadify('settings', 'fileSizeLimit') + "大小", 4);
					break;
				case -120:
					ui.error("文件 [" + file.name + "] 大小异常");
					break;
				case -130:
					ui.error("文件 [" + file.name + "] 类型不正确");
					break;
			}
		},
		onFallback: function () {
			ui.error('您未安装FLASH控件，无法上传！请安装FLASH控件后再试');
		},
		onUploadStart: function (file) {
			// 验证是否能继续上传
			var len = $('#works_image_list').find('li').length ;
			if (len > 3) {
				ui.error('最多只能上传' + 3 + '个图片');
				// 停止上传
				$('#uploadify_'+unid).uploadify('stop');
				// 移除队列
				$('#uploadify_'+unid).uploadify('cancel', file.id);
			}
		}
	});
	
    $('#ajax_verified_form').submit(function(){
        $(this).ajaxSubmit({
            beforeSubmit:  function(){
            	if($('#phoneOrEmail').val().length == 0) {
            		ui.error('帐号不能为空');
                    return false;
                }
            	if($('#phoneOrEmail').val().length == 0) {
            		ui.error('昵称／姓名不能为空');
                    return false;
                }
            	if($('#password').val().length == 0) {
            		ui.error('密码');
                    return false;
                }
            	if($('#repassword').val().length == 0) {
            		ui.error('重复密码');
                    return false;
                }
            	if($('#verify').val().length == 0) {
            		ui.error('验证码／激活码');
                    return false;
                }
            },
            success: function(json){
            	if( json.status == 1 ){
            		ui.success(json.info);
            		window.location = json.data.jumpUrl;
            	}else{
            		ui.error(json.info);
            	}
            },
            dataType: 'json'
        }); 
        return false; 
    });
})
</script>
</body>
</html>